﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace QuickShot.Utility
{
    public sealed class ScreenData
    {
        public static Point StartPoint
        {
            get
            {
                return GetStartPoint();
            }
        }

        public static Size ScreenSize
        {
            get
            {
                return GetSize();
            }
        }

        private static Point GetStartPoint()
        {
            Point startPoint = new Point();
            foreach (Screen screen in Screen.AllScreens)
            {
                startPoint.X = screen.Bounds.X < startPoint.X ? screen.Bounds.X : startPoint.X;
                startPoint.Y = screen.Bounds.Y < startPoint.Y ? screen.Bounds.Y : startPoint.Y;
            }
            return startPoint;
        }

        private static Size GetSize()
        {
            Size formSize = new Size();
            foreach (Screen screen in Screen.AllScreens)
            {
                formSize.Height += screen.Bounds.Height > formSize.Height ? screen.Bounds.Height : 0;
                formSize.Width += screen.Bounds.Width;
            }
            return formSize;
        }
    }
}
